import axios from 'axios'

import {
  NewsResource,
  NewsIdResource,
  NewsDateResource,
  NewsInfoResource,
  TopicsResource,
  TopicsIdResource,
  SectionsResource,
  SectionIdResource
} from './resource'

export default {
  getNews() {
    return axios.get(NewsResource)
  },
  getNewsById(id) {
    return axios.get(NewsIdResource + id)
  },
  getNewsByDate(data) {
    return axios.get(NewsDateResource + data)
  },
  getNewsInfoById(id) {
    return axios.get(NewsInfoResource, {
      params: {
        id: id
      }
    })
  },
  getTopics() {
    return axios.get(TopicsResource)
  },
  getTopicsById(id) {
    return axios.get(TopicsResource + id)
  }

}
